#ifndef SPRITE_SHIP_BASE_H
#define SPRITE_SHIP_BASE_H

#include "consts.h"
#include "cash.h"

class SPRITE_SHIP_BASE : public QGraphicsObject
{
    Q_OBJECT
private:
    QVector<QPixmap*> *vect_pix;
    QHash<QString, QVector<QPixmap*>*> *hash_sprites;

    int index;
    int timer_id;

    CASH *cash;
    bool flag_bounce;
    QString str_state;

public:
    SPRITE_SHIP_BASE(CASH *cash, QGraphicsItem* parent);
    ~SPRITE_SHIP_BASE();

    void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *);
    QRectF boundingRect() const;
    QPainterPath shape() const;
    void timerEvent(QTimerEvent *);

private:
    void load();

public slots:
    void start();
    void stop();
    void slot_finished();

    void slot_fly(MOVE_DIRECTION move);
    void slot_fly_finish(MOVE_DIRECTION move);

    void slot_transform(QString old_state, QString new_state);

signals:
    void finished();

};

#endif // SPRITE_SHIP_BASE_H
